#!/bin/bash
count=0
counterr=0
for i
do 
ping -c2 -W 0.5 $i &> /dev/null
if [ $? -eq 0 ];then
echo "$i：UP"
let count+=1
else
echo "$i：down" 
let counterr+=1
fi
done
echo "$count台UP-----$counterr台down"

